package day7;

import java.util.Arrays;
import java.util.Random;

/**
 * @Author juzipi
 * @Date 2021/6/9 21:01
 * @Info
 */
public class Demo {

    public static void main(String[] args) {

        int[] ints = new int[6];
        Random random = new Random();
        for (int i = 0; i < ints.length; i++) {
            ints[i] = random.nextInt(30);
            for (int j = 0; j < i; j++) {
                if (ints[i] == ints[j]){
                    i--;
                    break;
                }
            }
        }
        System.out.println(Arrays.toString(ints));

    }

}
